package com.ty.bigevent.controller;

import com.ty.bigevent.utils.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

@RestController
public class fileUploadController {
    @PostMapping("/upload")
    public Result<String> upload(MultipartFile  file) throws IOException {
        String filename = file.getOriginalFilename();
        file.transferTo(new File("E:\\2\\" + filename));
        return Result.success("url...");
    }
}
